import request from '@/utils/request'

/**
 * @description 创建计费规则
 * @param data
 * @return {*}
 */
export function createRuleAPI(data) {
  return request({
    url: '/parking/rule',
    method: 'POST',
    data
  })
}

/**
 * @description 删除计费规则
 * @param id
 * @return {*}
 */
export function deleteRuleAPI(id) {
  return request({
    url: `parking/rule/${id}`,
    method: 'DELETE'
  })
}

/**
 * 查看计费规则
 * @param id
 * @return {*}
 */
export function showRuleAPI(id) {
  return request({
    url: `parking/rule/${id}`,
    method: 'GET'
  })
}

/**
 * @description 编辑计费规则
 * @param data
 * @return {*}
 */
export function editRuleAPI(data) {
  return request({
    url: '/parking/rule',
    method: 'PUT',
    data
  })
}
